package com.example.demo.service;


import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;


/**
 * @Author: 聂吉泽
 * @Description:
 * @Date: create in 2021/11/18 11:04
 */

public interface CommService {

    /**
     * 上传单个文件
     * @param file
     * @throws Exception
     */
    void upload(MultipartFile file) throws Exception;

    /**
     * 下载单个文件
     * @param fileName
     * @param response
     * @throws Exception
     */
    void download(String fileName, HttpServletResponse response) throws Exception;

    /**
     * 文件压缩下载
     * @param downName
     * @param response
     * @throws Exception
     */
    void downloadZip(String downName,HttpServletResponse response) throws Exception;

    /**
     * 复制桶中文件到新的桶中
     * @param backupBucket
     * @param newName
     * @param oldBucket
     * @param fileName
     */
    void copyObject(String backupBucket,String newName, String oldBucket, String fileName);
}
